package com.songlanyun.modules.personaldata.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.validator.group.AddGroup;
import com.songlanyun.common.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 关于我们-个人资料
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-30 14:34:07
 */
@Data
@TableName("yxt_personal_data")
public class PersonalDataEntity extends RootEntity<Long, PersonalDataEntity> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    @NotNull(message = "主键不能为空", groups = UpdateGroup.class)
    private Long id;
    /**
     * 姓名
     */
    @Length(min = 1, max = 20, message = "姓名长度在1-20个字", groups = AddGroup.class)
    private String name;
    /**
     * 电话
     */
    @NotBlank(message = "电话不能为空", groups = AddGroup.class)
    private String mobile;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 是否处理
     */
    @NotNull(message = "状态不能为空", groups = UpdateGroup.class)
    private Boolean isDispose = false;
    /**
     * 备注
     */
    @Length(max = 200, message = "备注长度在200个字以内", groups = UpdateGroup.class)
    private String remark;

    @Override
    public Long getIdentity() {
        return this.getId();
    }
}
